package cn.kgc.service;


import cn.kgc.dao.UserMapper;
import cn.kgc.pojo.Email;
import cn.kgc.pojo.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("userService")
public class UserServiceImpl implements  UserService{


    @Resource
    UserMapper userMapper;
    @Override
    public User login(String username, String userpassword) {
            User user=null;
            user=userMapper.login(username);
            if(user!=null){
            if(!user.getUserpassword().equals(userpassword)){
                user=null;
            }
            }
        return user;
    }

    //接下来的是邮箱登陆
    @Override
    public Integer AddUser(User user) {
        return userMapper.AddUser(user);
    }

    @Override
    public Integer addEmail(Email email) {
        return null;
    }

    @Override
    public Email selectEmail(String code) {
        return null;
    }

    @Override
    public Integer updateEmail(String code) {
        return null;
    }
}
